import {  queryDetail, modifDetail } from './service';
import { message } from 'antd';

export default {
  namespace: 'setting',

  state: {
    details: {
      valueRuleList: {}
    }
  },

  effects: {
    *modifyDetail({ payload }, { call, put }) {
      const response = yield call(modifDetail, payload)
      message.success(response)
    },
    //详细查单位
    *queryDetail({payload}, { call, put }) {
      const response = yield call(queryDetail);
      yield put({ type: 'setDetail', payload: response })
    }
  },

  reducers: {
    setDetail(state, action) {
      return {
        ...state,
        detail: action.payload
      }
    }
  },
};
